// Create the tooltips only on document load
	$(document).ready(function()
	{ var timeoutShowPopUpID, timeoutHidePopUpID, currentEl, currentPopUpEl;
	$("#wrapper .node").append('<div id="popupdescr"><div class="top"></div><div class="center"></div><div class="bottom"></div></div>');
	var popupPosX = ($("#wrapper .node").innerWidth()-365)/2;
	var popupPosY = $("#wrapper .node").innerHeight()/2;	
	$("#popupdescr").css("left",popupPosX);
	$("#popupdescr").css("top",popupPosY); 	       
      $(".scheme_element").mouseover(function(){
	  	  clearTimeout(timeoutHidePopUpID);         
          var el = currentEl= this; 
          timeoutShowPopUpID = setTimeout(function(){showPopUp(el)}, 1000);
      });
      $(".scheme_element").mouseout(function(){
        currentEl =0;
         clearTimeout(timeoutShowPopUpID);                   
         // showPopUp(this);
         var el = this;
          timeoutHidePopUpID = setTimeout(function(){hidePopUp(el)}, 500);
      });
      $(".scheme_element").mousemove(function(){
        clearTimeout(timeoutShowPopUpID);
        var el = this;
        timeoutShowPopUpID = setTimeout(function(){showPopUp(el)}, 500);
      });
      $("#popupdescr").mouseover(function(){	  
	  	clearTimeout(timeoutHidePopUpID);
        currentPopUpEl = this;		
      });
      $("#popupdescr").mouseout(function(){
        currentPopUpEl = 0;
        var el = this;
        timeoutHidePopUpID = setTimeout(function(){hidePopUp(el)}, 500);
       });
      function showPopUp(el){	  	
		var elID = $(el).attr("id");
		$("#popupdescr .center").html($("#all_descr ."+elID).html());
		$("#popupdescr").fadeIn();        
      }
      function hidePopUp(el){	  	
        var elID = $(el).attr("id");		
		$("#popupdescr").fadeOut(); 
      }
});
